home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_300
/
364_01
/
readme.ca
< prev
Wrap
Text File
|
1992-05-25
|
53KB
|
1,244 lines
C-ACROSS (version 1.02): README.CA Page 1
/*
HEADER: ;
TITLE: C-ACROSS;
VERSION 1.02
DESCRIPTION: "Utility for multiple module programs. Produces
Six indexes of functions, prototypes, and globals that
enable user to 'see across' modules for use in checking
and comparison. One of these is type of hierarchical
functions list, a listing by module of functions
and calls made FROM them; another is alphabetical list
of functions and calls made TO them. Globals listed
in schematic descriptors which record all modifiers
and qualifiers and enable checking of declarators
across modules. Creates, on request, header file
consisting of prototypes constructed from function
definitions. Can list user defined types and some
preprocessor #defines. Full documentation in README.CA";
KEYWORDS: Utility, Cross Reference, Deubgging;
SYSTEM: MS-DOS;
FILENAME: FUNC_CA.C;
WARNINGS: "1. Assumes function definitions conform with
ANSI standards and have prototype form. See
also "Caveats and Restrictions" in README.CA.
2. Assumes syntactically correct source files.
3. Written and tested using Microsoft QuickC.
4. Copyright retained. See Copyright
information in README.CA.";
SEE-ALSO: EXITS_CA, FUNC_CA.C, GLOB_CA.C, IFDEF_CA.C, INTF_CA.C,
LINKL_CA.C, PARSE_CA.C, TDEF_CA.C, TYPES_CA.C, UTIL_CA.C,
UTLG_CA.C, XRF_CA.C, README.CA,
CA.H, CA.PRJ, CA.RPT, CDECL_CA.H, KEYWORDS.H;
AUTHORS: Myron Turner;
COMPILERS: Microsoft C;
*/
/*************************** C-ACROSS ***************************/
v. 1.02
Copyright (C) Myron Turner
333 Bartlet Ave.
Winnipeg, Manitoba
Canada R3L 0Z9
(204) 284-8387
/*********************************************************************/
C-ACROSS (version 1.02): README.CA Page 2
/*********************************************************************/
Version 1.02 of C-ACROSS does essentially the same things as Ver 1.0.
The major exception to this statement is that it now treats function
pointers as described in II.V. and V.1.f.
It has, however, undergone many silent changes and improvements,
among them, it has:
1. Expanded treatment of typedfes;
2. Improved algorithm for treating complex declarators;
3. Improved algorithm for checking truth values of preprocessor
conditions (#if/defs);
4. Added processing of preprocessor conditionals to the parsing
of function definitions and prototypes, the absence of which in
version 1.0 was a weakness;
5. Corrected logical flaw in GLOB_CA, which by both good and
bad fortune kept things working while it concealed a number of
places where there was room for improvement;
6. Added several new switches (and deleted one);
7. Fixed small glitch which prevented the recording of certain
initialized structure/union variables.
All in all this is a more accurate and more robust version, offering
more options.
C-ACROSS (version 1.02): README.CA Page 3
INDEX TO HEADINGS
PAGE HEADING
5 I.INTRODUCTION
6 II. TYPES OF LISTS PRODUCED
6 II.1. "I. FUNCTION DECLARATIONS AND GLOBAL VARIABLES"
7 II.2. "II. ALPHABETICAL INDEX OF FUNCTIONS & THEIR MODULES"
7 II.3. "III. FUNCTIONS (LISTED BY MODULE) AND CALLS"
7 II.4. "IV. LIST OF FUNCTIONS AND CALLING FUNCTIONS"
7 II.5. "V. LISTINGS OF FUNCTION POINTERS"
7 II.6. "VI. GLOBAL VARIABLES LISTED ALPHABETICALLY"
7 III. INSTRUCTIONS
7 III.1. DOS INCLUDE VARIABLE
8 III.2. PATH OF C FILES
8 III.3. COMMAND LINE
10 III.4. Using a PROJECT-FILE
10 III.5. EXAMPLE COMMAND LINES
11 IV. CAVEATS AND RESTRICTIONS
11 IV.1. PREPROCESSOR
11 IV.1.a. Conditionals (#if. . .#ifdef..)
12 IV.1.b. User defined types using #define.
12 IV.1.c. Using #define as compared to typedef.
12 IV.2. FORMATTING
13 IV.3. REPORT FILE PATHS
13 IV.4. COMMENTS
14 IV.5. FUNCTION DEFINITIONS: MULTIPLE LINES
14 V. READING C-ACROSS REPORTS
14 V.1. Reading the Main Report File.
14 V.1.a. Functions and Globals by Module.
15 V.1.b. Alphabetical listing of functions and their modules.
15 V.1.c. A listing of functions by module, in the order in whic
15 V.1.d. Alphabetical listing of functions and the functions wh
16 V.1.e. Alphabetical listing of globals, showing type, storage
20 V.1.f The Listing and Treatment of Function Pointers.
22 V.2. The SCRNOUT Report.
22 VI. ERRORS
22 VII. FILES INCLUDED ON C-ACROSS DISKS
23 VIII. COPYRIGHT
C-ACROSS (version 1.02): README.CA Page 4
I.INTRODUCTION
1. C-ACROSS is a utility for multiple module programs. It states
relationships between functions and produces annotated listings of
global variables. Its purpose is not to produce a hierarchical list
of functions (although it in part does that) but to enable the programmer
to see across modules in order to cross-check functions and variables.
C-ACROSS reads source files and (at the user's discretion) include files.
Therefore, it does not treat library functions, either standard C library
functions or functions drawn from a library of the user's own. Nor, for
the same reason, does it read other symbols, i.e., variables,
embedded in object files.
1.a. The term Global is used in this document to refer to all
variables which are characterized by file scope and external storage,
i.e. variables declared outside of functions and which are exported
to the linker. This distinguishes them from static variables which
have file scope but are known only to the files in which they are
defined. C-ACROSS does, however, list all static variables as
well as globals, even when they appear within functions.
1.b. C-ACROSS assumes that function declarations follow the ANSI
format:
int function_1(int i, char *p)
{
It may not read the old form reliably:
int function (i, p)
int i;
char *p;
{
The reason for this is that it does not expect to find declarations
between the closed parenthesis and the opening bracket to the function.
While C-ACROSS will probably read the function names correctly,
it will treat all or some of the formal parameters as globals.
The old form will, additionally, not allow for a correct /CDECLARE
file (See III.3.b.5).
2. Some of the kinds of problems which C-ACROSS will help resolve.
2.a. In the case of global variables the following declarations
will be accepted by the compiler and processed by the linker:
FILE_1.C
int testvariable;
int *_far testfarintp;
int i;
FILE_2.C
extern double testvariable;
extern int *_near testfarintp;
int i;
"The C compiler," as Harbison and Steele point out, "cannot verify
that declarations in different files are consistent. . . .The lint
program, usually supplied. . .in UNIX systems, can check multiple
C-ACROSS (version 1.02): README.CA Page 5
files for inconsistent declarations." (p. 94) C-ACROSS should
help programmers without access to a lint program check declarations
for consistency: C-ACROSS produces fully analytical descriptions of
both simple and complex variable declarations, listing them in table
form for ease of comparison. (See V.1.e. for further information.)
2.b. To facilitate function checking, C-ACROSS will produce a listing of
prototypes constructed from the actual function declarations themselves
which can then be used as a universal header file to check function calls
against the actual declaration statements. This is good protection
against certain illegal pointer errors that are otherwise difficult
to locate.
2.c. C-ACROSS shows at a glance which functions call every
user-def